package com.sky.config;

import com.sky.App2;
import com.sky.App3;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;

@Configuration
public class CommonConfig {
    @Bean
//    @ConditionalOnMissingBean
    public App2 app2_2(ApplicationContext applicationContext) {
        App2 app2 = new App2();
        System.out.println("hello app2_2");
        return app2;
    }

    @Bean
//    @ConditionalOnMissingBean
    public App2 app2_3(ApplicationContext applicationContext) {
        App2 app2 = new App2();
        System.out.println("hello app2_3");
        return app2;
    }
}
